package com.liuyang.second.concurrency.chapter1;

public class SingletonObject5 {

    private SingletonObject5() {
    }

    private enum Singleton{
        INSTANCE;
        private final SingletonObject5 instance;
        Singleton(){
            instance = new SingletonObject5();
        }

        public SingletonObject5 getInstance(){
            return instance;
        }
    }
    public static SingletonObject5 getInstance(){
        return Singleton.INSTANCE.getInstance();
    }
}
